Let's take this train of thought a bit further. Let's say you're teleporting to your starship, but due to a malfunction with the teleporter, you're left behind, but the teleportation is none the less successful.
Now there are two of you, identical in every way up to the point of teleportation. You have the same genetics, the same memories, and the same likes and dislikes. Assuming you were both into the idea (and if one of you is, the other must be as well), is this incest, masturbation, or something else entirely?
If you're just giving each other a good ol' handie, surely that would be masturbation? But if there's two people involved surely it can't be, by definition? But what if there's penetration, does it at that point evolve to incest? Or is the fact that you have identical DNA irrelevant, as there are no familial bonds, and you're not brothers, parents and son, or anything of that nature?
Now, what if the circumstances were different? Say you run into your counterpart from a mirror universe instead.
He looks almost just like you, minus a few differences, such as having more facial hair. However, unlike with your duplicate, the two of you don't share memories or a history. Your mirror counterpart has lead a different life than you, albeit with many similarities. However, he's still similar enough that he's completely into the idea.
Given that he's not even from your own universe, it can't even be argued that his DNA is a copy of your own. It's coincidentally identical, but you were in no way involved in this man's birth or creation, making your connection even more tenuous than your connection to the teleporter duplicate. Considering these facts, is this less incestuous and more masturbatory than the teleporter scenario? Or do the minor differences not matter, and it's just as masturbatory and incestuous, because, although he's a you from another world, it is still YOU?
And another idea to consider: What if instead of a flesh and blood copy, what if you were to create a duplicate of yourself in the holodeck?
Now you don't have to worry about any iffy DNA getting in the way, because this copy has none. It's even less like you than the others as well, because rather than a true copy, it's a recreation of yourself based on your own perspective of who you are, filtered through the computer's best attempts to decipher your vague inputs. However, it'll still want to bone you - you'd make sure of that, huh?
First there's the question of consent. This is a whole bag of worms in itself given that holograms are sometimes alive with their own free will, but not always. Even if it is, it's hard to say how much its desire to bone is its true want or simply its programming. Or perhaps if it's only agreeing because it thinks that's what you'd do in that situation, not necessarily what it would do, but it feels compelled to act as it thinks you would, knowing of its nature as a creation meant to please you. Can that really be called consent? Or does its desire to please you count as consent anyway, as even if it is only acting as it thinks you would, and not how it would, it is still ultimately doing it out of a desire to bring you pleasure?
In any case, does that even count as masturbation, much less incest? It's got no DNA. It's literally made of hard - very hard - light. It doesn't even have any memories of you, and if anything is more like an idea of you are. It may or may not have sapience or a will of its own.
If not, it's just a toy. No different than a robot designed to look like you. So getting off on it is just masturbating, right? But if you're not the one stimulating yourself, and it's doing it for you, does that count?
Masturbation is defined as "erotic stimulation especially of one's own genitals". So under this definition, it can't be masturbation, as you're doing nothing to achieve climax. But unlike in the above examples where another person is involved, I'd this hologram has no will, it's just a toy that looks and sounds like you.
Even if it is completely identical to you, the fact that it isn't Alice and only exists to pleasure you would surely make masturbation? Even isn't quite identical, but a flawed copy with major differences, does that even change anything?
However, if it is Alice and if you have sex with it, does it not become incest assuming you believed it was, and the copy was created with such a belief too, due to you being a sicko who's turned on by that sort of thing and wanted the copy to feel the same? Your mind makes it really, after all, they say.
Even if that's not the case, wouldn't it still be incest due to the fact that you were the one that made it, effectively making it your child, especially if it does has a free will of its own and is its own person? Or does the lack of DNA throw out that argument entirely?
And yet, what if you were to take your mirror universe duplicate, then replicate the teleporter accident on it, creating a teleporter mirror duplicate, and then create a hologram based on that new double duplicate to have sex with? Is that far enough removed from you that it's no longer masturbation or incest? How many copies of copies of copies does it take to become justifiable?
And to what end?
To explore your final frontier? For these the voyages of your genitals? For you r continuing, sick desire to explore strange, yet familiar holes? To seek out new but identical bodies? To boldly come where you've never come before...but also...you kind of have...?
AAAAAAAAAAAAAAAAAAAAAAAAAAAGH!