We know this because they use the name YHWH before it was revealed to Moses.
How do you figure? If Moses' narrative (let's assume he was real) uses YWHW before it was revealed, in the narrative, that doesn't necessarily discredit his authorship. Seeing as how he would have written the events after they happened, (obviously) he had license to reference the name. What Moses wouldn't have license to do, or rather what would discredit his authorship, would be if in the narrative he quotes himself using the divine name before it was revealed to him.
Do you have a reference for that? I'll be honest, I wasn't aware of such a thing. When you are educated by the Society, you read the book "All Scripture is Inspired", and that's generally all you'll ever look at (at least that goes for me).