I think sighting the full moon is the main trigger for a werewolf to transform in Potterverse, but I also wonder if it has something to do with the time of day. As you probably know, Lupin transforms at night in chapter 20 of Prisoner of Azkaban. He also references being escorted while still a Hogwarts student to the Shrieking Shack in the evening¹ by Madam Pomfrey, and clearly he hasn't transformed yet or else Madam Pomfrey would have been injured or killed. So I'm going to postulate that not only is the full moon the trigger for Lupin's lycanthropy, but perhaps Lupin's transformation is contingent upon the time of day. Specifically, the full moon at night may be the trigger. Not, for example, the full moon at sunrise or slightly before.
As a side note of sorts, Boggarts can induce a real reaction to the thing a person fears most -- for example, the Boggart!Dementor Harry used to learn the Patronus Charm induced the same reaction -- hearing his mother screaming and pleading, and him passing out -- as the Dementor on the Hogwarts Express did. However, Lupin's Boggart -- the full moon -- did not cause Lupin to transform into a werewolf. Perhaps this means the werewolf transformation cannot take place during the day, for Lupin's Boggart showed itself during a Defense Against the Dark Arts class. (There could be a number of factors as to why Harry reacted but Lupin did not when they faced their respective Boggarts)
As for why Lupin didn't transform into a werewolf while everyone was all in the Shrieking Shack, if indeed the transformation is time contingent maybe it simply wasn't dark yet.
¹1. the latter part of the day and early part of the night. 2. the period from sunset to bedtime: He spent the evenings reading. 3. Chiefly Midland and Southern U.S. the time between noon and sunset, including the afternoon and twilight. DICTIONARY.COM