There are a lot of ways and so it kind of depends on what tone you’re looking for.
Makes more sense to say “Don’t think I’m nosy, but...”. You don’t need “that” in this case.
Here are some other ways:
I don’t want to come across as nosy, but how many girlfriends have you had?
I was just wondering, how many girlfriends have you had?
I don’t want to cross a line, but I was curious how many girlfriends you’ve
There are way more than this but it depends on you. Hope it helped a little!