Because the Matrix is a rumor in the hacker community. Both Morpheus and Trinity are known within the Matrix as high profile hackers (and Terrorists). News of them is mainstream topics regarding their anti-government actions inside of the simulated world.
But mainly, there is the scene before Neo meets Trinity for the first time.
The Matrix Has You.
Follow the White Rabbit
Knock Knock Neo.
Someone, likely Morpheus, Trinity, or the Operator, contacts Neo via his computer and mention the Matrix, just an hour or so before he finds Trinity at the club.
As for Trinity knowing before being unplugged, it's just like it happens with Neo and everyone else. And the entire idea behind the Machine's using Neo to "fix" the problem with humans. The second movie is all about it.
The Architect: As I was saying, [The Oracle] stumbled upon a solution whereby nearly 99% of all test subjects accepted the program as long as they were given a choice, even if they were only aware of that choice at a near-unconscious level.
People who make the choice, subconsciously, become aware of how the world seems fake, wrong. They start to think and look for clues. People outside the Matrix leave clues. So the ones inside the Matrix start to figure it out. Then the Zion rebels actually track them down and teach them about it, some of it, before giving them the Red Pill Blue Pill choice. That is how Neo found out, that is how Trinity found out, and all the others we see in the movie and Animatrix.
Trinity explains it at the club:
Trinity: Please just listen. I know why you're here, Neo. I know what you've been doing. I know why you hardly sleep, why you live alone, and why night after night you sit at your computer. You're looking for him. I know, because I was once looking for the same thing. And when he found me, he told me I wasn't really looking for him. I was looking for an answer. It's the question that drives us mad. It's the question that brought you here. You know the question just as I did.
Neo: What is the Matrix.
Trinity: The answer is out there, Neo. It's looking for you. And it will find you, if you want it to.
And Morpheus expands on it later:
Neo: Because I don't like the idea that I'm not in control of my life.
Morpheus: I know exactly what you mean. Let me tell you why you're here. You're here because you know something. What you know you can't explain. But you feel it. You've felt it your entire life. That there's something wrong with the world. You don't know what it is but it's there, like a splinter in your mind driving you mad. It is this feeling that has brought you to me. Do you know what I'm talking about?
Neo: The Matrix?
Morpheus: Do you want to know what it is? The Matrix is everywhere. It is all around us, even now in this very room. You can see it when you look out your window or when you turn on your television. You can feel it when you go to work, when you go to church, when you pay your taxes. It is the world that has been pulled over your eyes to blind you from the truth.
Neo knows about the Matrix because of an ever present malignant doubt about life as he knows it. He KNOWS something is wrong, even if he can't explain it.