YES, you can predict when the animal has had enough of a child's attention. YES YOU CAN, you just pay attention to its signals. PAY ATTENTION. Poor dog, he probably took all he could and that was it.
I just had a long visit from a relative who brought their 4 year old grandson also along, he was playing with our big cat (18 lbs) twitches. and playing, and fussing, and playing and fussing. Normally Twitches is very social. But saw something in his face and body language. Told the kid, he has had enough leave him alone. You could see the cat had had it with the pestering.
Like wise my well behaved well socialized calm GSD was playing all day with my nephews, hours of good play etc. he came inside to get to his water bowl and they ran at him, he left out a low growl, (only heard that first time in 6 years) told the boys go in the other room now, he needs some space. That dog had played so long with the kids, earlier, he even did not take time to pee. I took him with me over to the side to get him to pee, and he peed like mad.
PAY ATTENTION. Even the most calm dog has their breaking point. I blame the HUMAN.