From the Catechism (vatican.va/archive/catechism/p3s2c2a6.htm– boldface mine, of course)
2382 The Lord Jesus insisted on the original intention of the Creator who willed that marriage be indissoluble.173 He abrogates the accommodations that had slipped into the old Law.174
Between the baptized, "a ratified and consummated marriage cannot be dissolved by any human power or for any reason other than death."175
2383 The separation of spouses while maintaining the marriage bond can be legitimate in certain cases provided for by canon law.176
**If civil divorce remains the only possible way of ensuring certain legal rights, the care of the children, or the protection of inheritance, it can be tolerated and does not constitute a moral offense. **
2384 Divorce is a grave offense against the natural law. It claims to break the contract, to which the spouses freely consented, to live with each other till death. Divorce does injury to the covenant of salvation, of which sacramental marriage is the sign. Contracting a new union, even if it is recognized by civil law, adds to the gravity of the rupture: the remarried spouse is then in a situation of public and permanent adultery:
*If a husband, separated from his wife, approaches another woman, he is an adulterer because he makes that woman commit adultery, and the woman who lives with him is an adulteress, because she has drawn another’s husband to herself.177 *
2385 Divorce is immoral also because it introduces disorder into the family and into society. This disorder brings grave harm to the deserted spouse, to children traumatized by the separation of their parents and often torn between them, and because of its contagious effect which makes it truly a plague on society.
2386 It can happen that one of the spouses is the innocent victim of a divorce decreed by civil law; this spouse therefore has not contravened the moral law. There is a considerable difference between a spouse who has sincerely tried to be faithful to the sacrament of marriage and is unjustly abandoned, and one who through his own grave fault destroys a canonically valid marriage.178
If a Catholic’s spouse is determined to separate and/or divorce, the Catholic doesn’t need to resort to false heroism that might undermine what relationship is left. A civil divorce is even permissible between validly-married Catholics, when the reasons are grave, as a means of, for instance, providing safety or of dividing the marital assets in justice (CCC 2383). Short of that, a legal separation is allowed if necessary for the spouses to live in peace. It is preferable to avoid civil divorce, if it is not needed to achieve justice and peace between the spouses, but there is no sin in the divorce if it proves to be necessary. (Sometimes, for instance, it is a choice to sin that destroyed the marital relationship; once there is no peace in sight between the spouses, a divorce might be morally tolerable.) I would say that this the kind of question which always calls for pastoral guidance.* IMHO*, it would be rash for a couple to make this judgment without obtaining guidance from their pastor(s) or the equivalent.
A Catholic is not bound to make legal pretenses in order to maintain the appearance of being the victim of a divorce. If the divorce cannot be stopped, then the Catholic does not have to make a show in court of trying to stop it. What is necessary is that those things that might have saved the marriage were tried.
If a person is validly married to you, it isn’t an act of mercy to give him or her a divorce. When divorce can be avoided without violating justice or putting someone in danger, it is a grave sin to be complicit. When divorce is morally permitted, it is for the sake of justice, not for the sake of sparing the person the emotional pain of sticking out through better or worse. After all, it is false love that would give permission to commit a grave sin that happens to be less immediately painful than virtue.
It may be the most civilized not to wage a war that will only result in further harm, though. If the sin is going to be committed no matter what you do, you don’t have to make everyone involved miserable in order to make a show of your refusal to be complicit. It is enough to have taken steps that would have some reasonable chance of changing your spouse’s determined course.
Obviously, none of this is a black-and-white thing to decide. It is more like deciding what treatment to take for your cancer! There gets to be a point where palliative care can rightly replace aggressive treatment aimed at a cure. You’d want to consult with your pastor, with a priest whose judgement you find sound, someone your pastor recommends, or the like. In some places, the shortage of priests is severe or the available priests have less training than some local Catholic lay counsellors do. IOW, this isn’t guidance that has to come from a priest, but it should come from someone that your pastor or chancery office is satisfied will give you advice in keeping with the teaching of the Church.
I really, really hope that all this turns out to be a theoretical consideration for you, though.