For, this you want to use a Singleton. In Godot, you do this by making a script, let's call it "global.gd". For example:
var level = 1
Now, go into Project Settings -> Autoload, and add this script, giving it a node name (for example "GameState"). Don't forget to check "Enable".
Now from any script in the project, you can access vars and methods from this script like so:
GameState.level += 1