They are not leg cramps, but most likely luxating patellas where the knee cap slips in and out of place. They are every common in Yorkies, unfortunately. If you look in the Health section, you will see tons of threads on the subject.
Luxating Patella: A Knee Problem in Dogs
He needs to be evaluated by your vet.