@Jack ****
The very first thing you need to do is find out if the embassy or consulate you'll be using allows applications for a "trailing spouse" visa based on you having a retirement or longstay visa.
Many Thai embassies have discontinued issuing this visa.
If they do allow it then you would apply for a non-O or non-OA retirement visa, depending on where you want to show your proof of funds. You would also apply for your wife's non-O trailing spouse visa right after you got issued your O or O/A visa
If they do not allow it, then you're not going to be retiring in Thailand until your wife turns 50 as well.
This is because your wife will have to qualify for a visa on her own and she won't be able to qualify for retirement visa until she's 50.
She could stay in Thailand on another visa type, like a Non-Imm-ED studying Thai language or on a DTV, until she hits the age when she can get her own “retirement visa”.
You cannot get a trailing spouse visa inside Thailand, and no other embassy in SE Asia offers this any longer.