If you've never milked cows, it may be hard to tell, but happy cows are very obvious if you know what you're looking for.
It should also be noted that stressed cows produce less milk, so it's economically advantageous to keep the cows happy.
I think that in other places sheep can be milked year-round by having them breed twice in a year, but I'd guess that this would tire the animals and reduce the quality of the milk and probably also the quantity (which is already quite low for sheep and goats). I really doubt goats can be convinced to do things the humans' way. I've never heard of anyone industrially breeding them and I can't imagine goats nicely lining up to be milked by a robot!
A lot of the lore that animal rights folks share about how dairy animals are bred and milked seems to be collected from a very particular kind of practice, focused exclusively on dairy cows in the US, and that isn't as widespread as the animal rights people would have you think. For example, I bet everyone has heard by now how cows are cruelly separated from their calves immediately when the calf is born, but I doubt as many people have heard of Salers cows that will simply not produce any milk unless their calf is touching them. Milk from Salers cows is a legal requirement for some PDO cheeses so while their numbers are few compared to Freisians, Jerseys, etc, they are no less cows and no less dairy cows. They're just the inconvenient kind (for milking, as well as for propagandising).