I believe it can be transferred upon your return to Thailand at your Thai Immigration office. Carry both passports with you. And UK should give you a form letter requesting Thai Immigration transfer and accept your new passport. If request letter not given then I think you will need to obtain it from UK Embassy Bangkok.
Possibly
@Ron ******
is better informed on the transfer of visa process.