How do I get the move Baton Pass?

Is it a TM? Or a move only certain Pokemon learn? If the second one, which Pokemon?

No. It isn’t but, there are ways to get it on certain Pokemon.

Instead of writing it down, I think I should just direct you to the bulbapedia page on Baton Pass. (It shows the Pokemon that can learn it via level-up and pokemon that get it via breeding.)

Page: http://bulbapedia.bulbagarden.net/wiki/Baton_Pass_(move)#Learnset