Technically the config lives in ~/Library/Preferences/com.binaryage.TotalSpaces2.plist
and ~/Library/Preferences/com.apple.spaces.plist but I don’t think it’s necessarily useful to back these up because the config and app assignments relate to particular displays and space ids, and I suspect what is happening is that the display id or space ids are changing.
I don’t know how to fix the cause of this.
However, I did make a helper app that may help. It’s called Display Spaces Manager, and you can find it here:
It might be able to save and then restore your display configuration after it has been lost.