There's no litmus test. Opinions differ. The idea transsexuals "just know" or "have always known" suggests it is a bright line. For some TS it is so. They always knew and it burns so fiercly in them that by their late teens they are living in their non natal gender role despite all the wrath an intolerant world can assault them with. You hear their stories and it seems a CD is nothing like a TS.
But many professionals in the field of treating gender troubled people report this line is in fact very blurry, and in many m-t-f's at least, the idea of wanting to live as other than their natal birth gets stronger with time, and can become all consuming later in life.
You can read such accounts at Anne Vitale's web site, or Carl Bushong's site. Parapharasing Carl's writings, he posits that all CDers are TS's, it's just degrees of their self acceptance of their mental identity vs denial of their identity. Society sends a message early on that it will not accept you acting in a role other than your natal birth gender and most TS children develop natal gender personalities to get by. He claims you can be happy by realizing this, and then what you do about it is up to you. Perhaps he is right, perhaps not. (this is probably the same thing ZenFrost said but in 3x the words)
So, back to your question, how do you know? You ask yourself and listen for the honest reply.
hugs,
'lissa