>>12495389the egg should be given to a Pokemon of the team. When this Pokémon will go on battle, it will take the egg with him, like a berry.
The egg would then need to be attacked by type-related attacks. Like if a Fire Pokémon is inside, then the Trainer should try to put his Pokémon in contact with fire opponents. The amount of "damages" needed for the egg to hatch need to be pretty big too. In case of double-type, it will need a decent amount of damages from both type.