I believe OP is referring to this feature for passing egg moves between parents
> In Pokémon Sword and Shield and Pokémon Brilliant Diamond and Shining Pearl, if two Pokémon of the same species are placed together in the Pokémon Nursery, if one of the Pokémon has an empty move slot and the other knows an Egg Move, the Pokémon with the empty slot will learn the Egg Move. This will occur even if the Pokémon are the same gender.