Kami said it was an inborn instinct, and that his ancestors had passed down the knowledge to him or something like that. The ability can probably be trained though, since Dende's dragon was more powerful than Kami's and Moori powered up the reviving abilities of Porunga.