There are a decent amount of Rare Candy scattered around the islands, Royal Avenue, Battle Tree, you can get them as a gift from the cafe and from a Pokemon with the Pick Up ability although it'll be extremely rare for them to get. The last way, is through the Festival Plaza but the chances are also low to receive one from one of the shops. I recommend just increasing the level of your Pokemon by grinding rather than consuming hours of your time to get one Rare Candy :)
For a method, a guaranteed way to get a candy is from the Battle Tree but at the cost of precious battle points.
Locations for Rare Candy in the wild: Route 6, Aether House, Aether Paradise, Brooklet Hill, Hau'oli City, Lush Jungle, Melemele Sea, Po Town, Poni Wilds, and Vast Poni Canyon