I have 3 at one of my settlements, they just showed up one day. Don't think I did anything special to attract them. It was a small settlement that was just starting out so I think its just random.
In short.... I have no idea
There is supposedly a random encounter with someone that sells a Brahim that allows you to buy one, but I have never encountered it.
Brahmin http://fallout.wikia.com/wiki/Brahmin_(Fallout_4) (spoiler for some...). I don't think it's "bathtub" you should use, rather one spesific for Brahmins, Brahmin troughs.
Cheers,
-klevs
You can buy them at a traveling vendor
Well in the beta update you can move them between settlements from the Workshop menu as this picture illustrates.
http://ocau.com/pix/ombti
I'm not sure if you can do that with the release version of the game.
As others have said you can search out Kelly the cow lady.
I've come across her a few times at the various "random event" locales and always buy a cow for 100 caps, although I have to drink a brew to boost my charisma, so always travel prepared.