Acquire 'Dismount Strike' skill from the 'Traveler' tree, then get on a mount. Ride up to a strider, longhorn, human, or other "small" enemy and press the 'c' (default) when prompted.
Medium or larger machines, depending on difficulty and spear upgrades, may not be killed by the dismount strike. They must be killed by the dismount attack for it to count.