Even though the Cosmog you befriended along your journey ended up becoming Lunala, you can still obtain another one in game so you can add it and its secondary evolution to your Pokedex. However, the way of obtaining it is quite complex. In order to find it, you must first defeat the Elite Four and the main storyline of the game. By doing this, it will turn to day in Pokemon Moon. After such occurrence, you can return to the Altar of the Moone with Lunala in your party and go back to The Reverse World, where it will then be night once again in your game.
From there, still with Lunala in your party, go to the Lake of Moone off Ula'ula Meadow, all the way up to the lonely Altar. Cosmog will soon appear, being only at Level 5 with the move Splash, and it will want to join your party. You won't have to Battle it; it will want to join you and your gang automatically. This Cosmog will eventually evolve into Cosmoem at Level 43; Cosmoem will later evolve into another Lunala.