We're meant to assume there's an off-screen conversation between Tyrell and Deckard, and that's when this information about Rachael's memories is shared.
The actual scene is cut short after Deckard realizes Rachael is a replicant. However, we are not supposed to think the conversation ends there. We know at least in the theatrical version the conversation must have gone further, because in the tacky "happy ending" Deckard's voice-over informs us:
"Gaff had been there, and let her live. Four years, he figured. He was wrong. Tyrell had told me Rachael was special: no termination date. I didn't know how long we had together ... who does?"
So they definitely continued discussing Rachael in at least one version of the script. It seems natural to assume Tyrell shared at least a couple of examples of memory implants.
The question remains, are they "too detailed" for Deckard to know? He mentions only two memories. Let's see in how much detail:
Memory #1: "playing doctor"
"Remember when you were six? You and your brother snuck into an empty building through a basement window ... you were gonna play doctor? He showed you his, and when it got to be your turn you chickened and ran. Remember that?"
Memory #2: "the spider"
"You remember the spider that lived in a bush outside your window? Orange body, green legs? Watched her build a web all summer. Then one day there was a big egg in it. The egg hatched..."
Barely sketches! It's pretty simple to memorize both in a single conversation. In fact, he doesn't even finish the second memory; it's continued instead by Rachael, showing it's a memory she actually remembers and not a wild guess or something generic.
So to me the answer is clear: Deckard knows at least these two memories because Tyrell told him, after Rachael's VK test. He knows them at a sketchy level, specific enough to scare Rachael, but not in so much detail he couldn't have learned them in the course of a single conversation.