What are these bites, actually? There's a wish to stop you moving fast. I watched strays running after cars, some dogs attacking bicycles, the wheel attracts the dog as a prey in its "funny" movement. You became his prey in his play. In order to stop this before your best clothes were ripped to bits you take your puppy on shorter leash (your hand as close to his collar as you can, immobilizing him a little) and continue running/walking. He will learn soon, that his attempts to bite your legs lead to restriction. My dog was the same, she was biting my sleeve and my hand, but she stopped when I showed her that I'm serious about moving forward and doing nothing else on the way.