The idea is to switch to a scene that runs a loading animation and having a thread to set up the next scene. once the thread is finished you remove the loading screen scene and add the new scene created by the thread into the tree. The code below is something i just typed up for you to get an idea of how to go about this, I didn't actually test this code.
onready var load_stuff = Thread.new()
var current_scene= #your scene here
#new_scene here is a node and loading is a boolean
# Add new scene as child of root
# optional, to make it compatible with the SceneTree.change_scene() API
get_tree().set_current_scene( current_scene )
# if we are using the loading scene then we want a thread to prep next scene
#your code for setting up the next scene goes here
var s = ResourceLoader.load(path)
var scene= s.instance()
#make sure if add_child function is used anywhere during the thread you use call deferred since add_child() is not very thread safe, look at the goto_scene for an example of this.
#once the new scene is prepared we can switch to it, also set false since we aren't doing the loading screen again
load_stuff.call_deferred('wait to finish')