Researching another question, I came across a quote I was looking for that seems to show werewolves only transform in the moonlight:
A cloud shifted. There were suddenly dim shadows on the ground. Their party was bathed in moonlight.
Snape collided with Lupin, Pettigrew, and Ron, who had stopped abruptly. Black froze. He flung out one arm to make Harry and Hermione stop.
Harry could see Lupin's silhouette. He had gone rigid. Then his limbs began to shake.
"Oh, my --" Hermione gasped. "He didn't take his potion tonight! He's not safe!"
I had always figured that when he was in the Shrieking Shack he was shaded from the moon, so it didn't affect him. But then I thought about his school days - where was he when he transformed? The Shrieking Shack! And if it does take moonlight, why couldn't he just hang out in the dungeons or somewhere else in Hogwarts?
Anyone see a way to reconcile these?