I had an ottb 3 yr old tb mare that had quite severe stifle lock in both hinds. It appeared only 2 weeks after I got her, while she was letting down from racing so was very light on. She was yarded at the time from being severly foot sore (trainer ripped shoes off her then threw her out in the paddock).
She would walk stiffly for a few strides, then one leg would get stuck backwards. Initially walking her backwards solved the immediate lock by pushing the ligaments back over the patella, but in a week it had got so bad that she couldn't move that leg until I manually pushed the ligament back.
Vet came out and said that although usually it's not so good that they gain rapid weight, she needed to stack it on within a couple of weeks to help support the ligament (having said this she was SKINNY so stacking it on meant getting her to a normal healthy weight in a couple of weeks), to assist her weight we had to give her two injections of B12 to increase her appetite.
Once she had put on a little weight, I had to start walking her up and down a hill twice a day for at least 30minutes a go. So on foot, up and down a huge hill twice a day- I got fit! This built the muscle up over her hindquarters and stifle area, which further supported the ligaments which were catching on the patella.
Once I'd walked her like this for a week, she was cleared to be back in the paddock, HAD to be a slopey paddock so that she could exercise herself, and I was to rid eher up hills for 20mins a day, walk and trot only, canter was totally unbenifical.
Once she was in full work and kept permanently in the paddock, I didn't have any problems with her, other than when she was brought up for injuries and out of work.
Stifle lock in it's initial stages can be resolved by building up the muscles around the stifle to support the ligaments (stifle lock is caused by the ligaments which run over the patella getting 'hooked' instead of running smoothely over the joint, so by having the horse at a good weight, and well muscled behind this will suport those ligaments and help them to run smoothly over the joint).
I would be working your boy on hills in walk and trot and see if that improves the situation. Your vet can also show you how to manually put the ligament back in place should you get stuck. It's a simple correctly angled 'push' under the patella ;)
In severe cases, the offending ligament can be cut, however this is strongly advised against as the majority of horses who undergo this procedure develop arthritis within 4 years because of bone chips developing.