The route runs through the space stage first. Collect all the Chaos Emeralds there, then travel to Nocturne to pick up the final two.
After that it is a matter of beating the boss three separate times. Once the third fight is done, a cutscene rolls that strongly hints at a sequel.