Cosmog first appeared in Secret of the Lake!, where it was created by the spirits of Solgaleo and Lunala. The group, having entered the Lake of the Sunne after Nebby was drawn there, witnessed the event. Cosmog immediately bonded with Nebby, as they were both of the same speices. Realising that this Cosmog was newly-born, Lewis decided he couldn't leave it alone and offered Cosmog the chance to travel with them. Cosmog accepted this and was caught by Lewis.
In The Cracking Dimensions!, despite being told by Gladion to remain hidden, Cosmog escaped from its Poké Ball to try and save Nebby, who had been captured by Lusamine. As a result of this, Lusamine managed to capture Cosmog as well and began draining both Pokémon of their energy, allowing her to open several Ultra Wormholes across Alola. Desperately weak, Cosmog evolved into Cosmoem to conserve its energy.
Later, during the Ultra Beasts' assault on Alola, Lewis and Lillie arrived at the Altars of the Sunne and Moone. Cosmoem once again escaped from its Poké Ball and evolved into Solgaleo, alongside Nebby who evolved into Lunala. With their newfound powers, Solgaleo and Nebby opened an Ultra Wormhole and took Lewis and Lillie to Ultra Space.
In the next episode, Solgaleo was used by Lewis in his battle against Lusamine in Ultra Space. It faced off against her Nihilego and proved itself to be a powerful battler, almost defeating the Ultra Beast before being interrupted by the collapsing area. Solgaleo went with Lewis, Lillie and Nebby to try and find Mohn, Lillie's father, who was trapped somewhere in Ultra Space.
Cosmog, in contrast to Nebby, is rather reserved and quiet, although it willingly played with Nebby and the other Pokémon, showing a playful side.
Cosmog also seems to be rather trusting, as it agreed to go with Lewis despite only just meeting him.
After evolving into Cosmoem, it became much more subdued and showed absolutely know emotion.
Upon fully evolving, Solgaleo reverted back to its original, playful personality, happily hugging its Trainer after opening an Ultra Wormhole. As a Legendary Pokémon, Solgaleo proved itself to be an exceptionally powerful battler, dominating in its battle against Nihilego. In the same instance, Solgaleo was shown to know restraint, instantly stopping the battle once Ultra Space began collapsing, knowing there was no point in continuing.