Definitely consult a lawyer.

If it looks like she is imminently going to file, I’d retire. Go through the divorce and financial split while you are retired. She gets her money at that point based on you not earning any more. Perhaps won’t get alimony if you’ve retired.

Get the $$s split done so you lose as little as possible. Once it’s all squared away, then you can look at deciding to get a new job.

If you start a new job, well paid, and then she files - it could put you in a much worse financial position.