Filch probably tipped him off.
There are three contributing factors at work here that I think indicate how Dumbledore was able to know that Harry would be using the Mirror of Erised that night.
- Dumbledore himself had only recently given Harry the Cloak - and he knows how inquisitive Harry is.
Remember that Dumbledore himself gave Harry the Cloak in the first place. Harry gets a magical Cloak of Invisibility. Are we really to suppose that Dumbledore thought Harry wasn't going to use it? If you give someone a Cloak like that then you wouldn't be surprised to find out that they've been wandering around at night when they weren't supposed to. It's basically an aide to rule-breaking. Dumbledore knew that James used it to steal food from the kitchens. I don't think he was at all surprised to find Harry using it for mischievous purposes over the Christmas period. Harry gets given an incredible Cloak. It's only natural that he'd want to try it out straight away.
Also bear in mind that Dumbledore knew about Harry's natural penchant for curiosity. By the midpoint of his first year Harry had already flown unsupervised on a broom when he wasn't supposed to. He crept out for a midnight duel when he wasn't supposed to. He fought off the mountain troll with Ron when he wasn't supposed to. Dumbledore knows that Harry is a rule-breaker. So Harry is bound to use the Cloak. And the Mirror of Erised is one of the most fascinating things he might come across on his wanderings. Perhaps Dumbledore thought that it was only natural that he'd find it sooner or later.
However, Dumbledore had some more concrete intel that Harry had found the Mirror. Filch is obviously the member of staff who has the primary responsibility for policing the corridors at night. He is also a stickler for disciplinarian. He seems to go running to Dumbledore every time he thinks a rule is being broken. Consider the following examples:
“Even more work for me! Mopping all night, like I haven’t got enough to do! No, this is the final straw, I’m going to Dumbledore-”
(Chamber of Secrets, Chapter 13, The Very Secret Diary).
“Never mind, my sweet...we’ll see Dumbledore in the morning...tell him what Peeves was up to...”
(Goblet of Fire, Chapter 25, The Egg and the Eye).
So Filch has an interest in catching Harry out-of-bed. So does Snape:
“You asked me to come directly to you, Professor [Snape], if anyone was wandering around at night, and somebody’s been in the library - Restricted Section.”
(Philosopher's Stone, Chapter 12, The Mirror of Erised).
Snape can put two and two together. So can Dumbledore. Filch has already come within a whisker of catching Harry earlier in the book. On Malfoy's information, he came very close to finding Harry, Ron, Hermione and Neville in the trophy room. He knew that there were students out of bed that night because he chased them through the castle. Despite not catching anyone in the act, you can bet that Filch would've gone running to Dumbledore in the morning. It wouldn't have taken a genius to work out what had happened.
Then, some time later, Snape and Filch would've come to Dumbledore on Boxing Day (the 26th) telling him about a night-time disturbance in the Restricted Area of the library the night before. Snape and Dumbledore would both have made the connection with the earlier incident and known it was Harry. Knowing roughly where Harry disappeared, based on their story, Dumbledore would've made an educated guess about which room Harry had disappeared into.
Harry decides to go back to the Mirror that night (the 26th):
“You could have woken me up,” said Ron, crossly.
“You can come tonight, I’m going back, I want to show you the mirror.”
(Philosopher's Stone, Chapter 12, The Mirror of Erised).
Dumbledore, knowing both that Harry has the Cloak and that he has probably found the Mirror, decides to make himself invisible and see whether his guess is accurate. Hey presto, Harry and Ron turn up. Ron tells Harry what he sees in the Mirror - Dumbledore overhears this and that's how he's able to tell Harry what he does in the quote. He was simply eavesdropping at the back of the room.
The next night (the 27th) Harry resolves to go back to the Mirror alone and it's on this occasion that Dumbledore reveals himself and explains to Harry what the Mirror is.
- Dumbledore knew that the Mirror of Erised was dangerous.
This is a supplementary point. It may be that, considering the risk that the Mirror poses to people who look into it, Dumbledore was keeping tabs on the Mirror-room anyway. Whether this was in the form of detection charms as @JasonBaker suggests or not isn't clear. But Dumbledore certainly knew the Mirror was dangerous.
"However, this mirror will give us neither knowledge or truth. Men have wasted away before it, entranced by what they have seen, or been driven mad, not knowing if what it shows is real or even possible."
(Philosopher's Stone, Chapter 12, The Mirror of Erised).
If you're going to put a Mirror that can send a person crazy in a school then it's only responsible to keep an eye on it.