After you defeat the fused Necrozma, you can follow it to Megalo Tower in Ultra Megalopolis.
Ultra Wormhole
During the Ultra Warp Ride, tilt your 3DS to control your flight. Press A to go back to a neutral position. Absorb the energy balls to go more quickly and restore energy, and avoid electric obstacles.
Try to go to the white warp hole and avoid getting close to the others, because if you get too close, you will get pulled in.
If you get pulled into a warp hole other than the white warp hole, you will be in Ultra Space Wilds, where you can encounter pokémon that don't appear in the Alola region. Flashier warp holes that are farther away are more likely to lead to rare pokémon. It is possible to catch Legendary Pokémon via the Ultra Wormhole.
If you end up in Ultra Space Wilds, check on the warp hole to return to the Altar, then talk to the Ultra Recon Squad to try the Ultra Warp Ride again.
The white warp hole will take you to Ultra Megalopolis.
Ultra Megalopolis
If you need to go back to Alola, you can talk to the Ultra Recon Squad members.
Otherwise, go north to enter Megalo Tower.
Megalo Tower
Go to the top of the tower and there will be a cutscene.
Then you will battle Ultra Necrozma. As before, you can't catch it, so just try to defeat it. It has a stat-boosting aura like Totem Pokémon. It's moves are Photon Geyser (Psychic), Dragon Pulse (Dragon), Power Gem (Rock), and Smart Strike (Steel). It is weak to Bug, Ghost, Ice, Dragon, Dark, and Fairy.
After the battle, your pokémon will be healed, and you receive Poipole.
Next, you will be given the option to ride Lunala or Solgaleo back to Alola, or you can say that you are not ready yet. Talk to the Ultra Recon Squad when you are ready.
After you choose, you will return to the Altar. You will receive three Beast Balls that you can use to catch Ultra Beasts.
You can return to the Altar and check on the wormhole at any time to go on the Ultra Warp Ride again, for a chance to catch Legendary pokémon.
After that, Captain Mina tells you to go to her house in Seafolk Village to do her trial. If you wish, you can go there together with her. Mina's house is the Whiscash-shaped boat. Talk to Mina when you are ready for the trial.