Did you have him vetted before you bought him? he could have some pain when making his transitions, does he still do it when lunged? and is his saddle fitting? Sorry lots of questions but without seeing him it is a difficult one. We had a youngster on loan a few years ago and he started to do this, we found that his saddle was no longer fitting properly.
I have had an ex racehorse myself and they do often become quite arthritic as they have had very hard lives from a very early age.