Have a global script with a dictionary or array so it can be accessed anywhere
Update the values as normal.
Save dictionary to file on conditions like
- The game quit
- A stage got cleared
- The player has the game idle
- Save point reached
The saved file automatically overwrites the old one when saved so it may be a good idea to have multiple dictionaries or save files for things like configuration, progress, consumables, status
This is only one approach and not coding law