Seems like a good idea, but with the risk that if you say you're choosing to stay "for the company" then the company can insist that actually it's better for them if you go to the new role. If you say it's about your family situation, then it's harder for them to insist.
Well, that's the sort of risk assessment that only you can make. My experience has been that a company won't do that, but you know yours better than I do.
But if I were to work at a place where I felt similarly, I would absolutely be looking for a job elsewhere.