In Ocarina of Time, you must go to Lon Lon Ranch and speak with Ingo. When he asks you to race, agree. Then, play Epona's Song to tame Epona, and then choose her as your horse to ride. If you win against Ingo twice, he'll let you have the horse. He'll close the gate on you, however, so you have to gain speed and jump over the outside fence. You'll land in Hyrule Field.
But in Majora's mask you have to help Romani the ranch girl. But you need a bow and a powder keg to do that. Go to the giant boulder and blow it up using your keg. Then help Romani with her Ghost problem (I suggest you slow down time) and she will give you lots of goodies like Epona and the song. If you help Cremea deliver her milk you'll get a mask or a hug if you already have it.
In Twilight Princess, Epona is already accessible early on in the game, but you lose her when Ilia is kidnapped. She reappears in Kakariko Village, but she ends up running wild and you'll have to wrangle her in order to calm her down and be able to use her again.