It's a good question !! In the world of biological sciences, the yawn is clearly defined as an act of taking in large amounts of air often because of fatigue. There are other thoughts but it appears that our brain needs more oxygen at the point where we involuntarily conduct the yawn. It will usually be accompanied by low adrenaline, low cortisol levels and a slow heart rate. Most people believe that we yawn because we are sleepy.
It is clear to me that horses yawn when their brain needs oxygen. We can take this in several directions because as humans we often yawn during states of boredom. Horses are, by their very nature, hyper-vigilant. I believe that we can justifiably say that the horse that is yawning is a happy horse. Evidence of that will show that an unhappy horse has a higher heart rate and thus is more vigilant.