It should use the attributes Agility and Endurence.
Should this skill be specialisated by animal (i.e. Legendary horse rider but Dabbling elephant rider)?
Well, if we consider it, the act of riding an animal efficiently depends on some very quantifiable variables, most of which could be (If I miss something please say so):
From the rider:
-Phisical trait ease (Taller humans can mount easily, a snail man might slip out a bit, etc.)
-being wounded, stunned by fear or other non-permanent stats could make things worse
-Ability (Even if you are wounded, a legendary rider could possibly do things very easily)
From the mount:
-'Easyness' to ride (For the sake of reality, riding a cammel would feel really more uncomfortable for a human than riding a horse. Had the rider be of any other form, this might be different). Essentially the shape of the animal, specially where you'd ride it, but obviosuly relative size between rider and mount is important
-obviously wounds too. In an even more important part than riders (which at best can be unable to mount, and at worse can fall of of an sprinting horse). A horse with a broken leg can't move anyone around
-Disposition (the mood and trust/loyalty it has placed on you). Agressive horses throwing out overly confident riders is a pretty old trope. Disposition should also govern how much weight you can pack on an animal before it drops it down pissed, but it wouldn't use the riding skill
*Non-sentients can't learn, although this is an easy placeholder, as animals can actually be trained in the game, right now , unless you use a workshop in fort mode, I dont think a horse will be able to learn it's equivalent of a riding related skill, so it will be mostly it's disposition to ride what'll decide his part of the calculation
The comfort/shape of the rider/mount, as both move around can be neglected if the rider uses a properly designed saddle
Most discomfort comes from riding bareback, which, although possible, could even lead to injuries in novices
Then, we'd need to know what does the rider skill do at all
as others have said, there are 3 things right now in the DF universe that could be governed by the rider skill
-Mounting/dismounting speed, reducing also the chance of being thrown down by the horse
-Controlling the animal and making sure it obbeys your commands when you are both moving, on top of by it's side (Honestly, this should also be affected by atributes like empathy and traits like confidence, etc.). A proper rider can also control carefully his mount so it can run more and longer more efficiently, or make it use it's abilities
-Reducing pain and tiredness from riding for long periods of time
So, we could easily boil down all stuff to a mix of comfort, skill, trust, endurance, and size relationships from both the mount and the rider. That's what'll decide how long, if they can even move together, a pair will go