To add to Indigo's answer, if you breed a Female Swinub with a Male Prinplup the Swinub that hatches from the egg will have Stealth Rock as long as the Male Prinplup has it. But if you breed a Female Prinplup with a Male Swinub even if the Swinub has Stealth Rock the Piplup that hatches from the egg will not have Stealth Rock.