I guess by using a custom signal in the _ready() function. You first declare a signal as
signal example
then you use emit_signal("example")
in _ready() function. Then you select the node with which the script containing example signal is attached and go to the Inspector tab where you will see a example signal under Signals that you created. Connect that and you're good to go. However you must have a script in the scene that you are switching to. There are definitely people here in the community with amazing knowledge but I don't know why they haven't answered your question yet. Let's hope they'll resolve your query but make sure you try my fix too.