@Jonas ************
, You can enter Thailand using both passports when you get a new one when you are out of Thailand.
You are supposed to have the correct documents to stay in Thailand: the right passport with the right permission inside.
The timing of transferring could depend on what you need to do at the local office next. You can go to the office asap. anyway, You must transfer stamps at least before earlier one of the dates of, your next 90-day report or extension application. Even you do both of them in one visit. They have you transfer stamps first, then let you apply for an extension or submit a 90-day report.
We advise people to transfer stamps earlier rather than later.