You'll probably need to use an autoloaded scene / singleton. This is a scene that is essentially "global" in that is loaded when the game is first run and doesn't restart when switching scenes.
The docs explain it pretty well:
https://docs.godotengine.org/en/stable/getting_started/step_by_step/singletons_autoload.html
To do this, make a new script by clicking "script" > 'File" > "New Script..." in the editor. I name mine "Globals" usually. Then click on "Project" > "Project Settings" and click on the "AutoLoad" tab. Then, click the little file icon and select the "Globals" script you just made, and then click "add". Now you can access this script from any other scene/script just by typing the name of the script.
For your purpose, I would go into the global script and make a new var class = null
. Then in your first scene, when the player chooses their class, you do Globals.class = self.class
. Finally, in the next scene, you would do onready var class = Globals.class
and then you could set_text(class)
on a label to display the class.