Obsidian Wings has a discussion going on this New York Times story on the uncertain legal status of married couples when one changes sex. Obviously, taking sex out of the equation would solve the problem, but that's apparently going to have to be done state by state.
As it stands, I would think that a federal law defining how sex is legally determined would be feasible. DNA would probably be the better choice, given the abilities of plastic surgery. It would create some silly situations, but at least it would be consistently measurable and would eliminate one legal variable.
One general thought occurred to me: assuming the couple continues to have a sex life, the woman involved would have had to change her sexual preference. This could bring up a decision if the transgendered partner dies first: switch back or not? I know this would be an individual decision, but it does demonstrate the complications.