In the Haunted Zone, there are two trees flanking the door to the Haunted Mansion. Dashing into the tree on the left knocks down a Metapod, while the right one holds a Kakuna. After you've found Rotom, return and speak to both Metapod and Kakuna, and they'll become your friends without needing to win a Skill Game.