I think it's splitting hairs to wonder who the "watch out!" is being directed towards. I mean, if you yell "watch out!" at the grocery store because your toddler and the cart someone is pushing are about to collide, it will get the attention of both the toddler and the cart-pusher. Actually, it seems more likely to me that the adult cart-pusher will pay attention to the warning, even if it's meant for the toddler. I mean, one wouldn't expect that upon yelling "watch out!" the toddler will stop in his tracks, look around, and remove himself to safety, while the adult cart-pusher blithely continues on their path without stopping, slowing, or even noticing the kid. (I'm sure it does happen, but not really what you'd expect.) Even if someone yelled "watch out, Timmy!" in my vicinity, I would be glancing around to see if Timmy and I were about to collide.
I think if you're at the point where you're yelling "watch out!" in a grocery store, it's a safety issue in that moment, and you say what you need to say to alert everyone to the fact that there's a problem. To me, it's what happens afterward that's more important in determining politeness--Timmy's mom apologizes to me and starts chiding Timmy vs. Timmy's mom chides me. And, what happens before--if Timmy can be prevented from running around the store in the first place.