This is... exactly how I was going to do it! Especially because I don't like the conventions I used to create variables now that I have a better grasp on how this whole thing works.It's probably better that way. It helps you ignore unnecessary flags and variables, while only dealing with the most necessary ones.
You also don't necessarily need to do a KotOR2/Mass Effect 2/Witcher 3 style dialogue where you ask the player about all of their flags in a single conversation in-game early on, but you could spread those choices out over time, and have them come up contextually. Like, say, Book Two Nelson doesn't mention Tara in their internal monologue, but then they bump into someone from high school who mentions Tara and says "Hey, are you two still super-besties like you used to be?", and then you can have dialogue choices like "Yes we are", "We actually started dating", or "We actually started dating, but then we kind of grew apart", which would then set your flag for Tara Romance to "No", "Yes", or "Ended". Or Mara shows up and while Nelson is thinking to themselves about how helpful they were in solving Lisa's murder, you get a choice like "Mara was really helpful, I'm glad we're friends" or "And then we became more than friends, and that's awesome."
It could even give you a bit more granularity - like if you want to distinguish between someone who did the sex ritual with Rain because they were desperate to solve the crime, someone who did the sex ritual because Rain's really hot, and someone who avoided the sex ritual entirely because they weren't interested.
In the same way, it could even add nuance to past scenes that the current flags don't allow for. Like if the current flags are really only Romance=yes or Romance=no, you could have a conversation in Book Two that discusses hooking up with Sophia and you get choices like "To be honest, I kind of thought she was hot for a while!" or "It was kind of just an impulsive spur-of-the-moment hook up" or "It was mostly just kind of a pity hook-up because I felt a bit bad for her?"
That way you only really only have to reestablish relationships or events shortly before they become relevant again, rather than overwhelming potential new players with a ton of questions all at once (which was really an issue in Witcher 3, where they spend a full scene asking you about people and events you may know nothing about to establish all the major Witcher 2 flags). And you can define them in whatever way makes them useful for the new game, not just to accurately reflect the previous game's world state.
It wasn't going to be just one conversation at the start, but various ones as they come up, that also let you choose context (ie - the reasons for Rainsex) or to even change your mind about relationships (breaking up with someone, especially if they turn out to be the killer).
And yes, this also allows for people to play Book Two without having played Book One, but I think most people will have wanted to start from the beginning.