When you defeat a Mega Raid Boss or a Mega Legendary Raid Boss, they turn back into their regular form before you encounter and catch them, so their regular form will appear in your storage. To turn them into their Mega Form, collect enough Mega Energy to Mega Evolve them.