this won't help for all your situations, but two things that have helped me:
Leaving 10 minutes before I thought we needed to. If I leave when my child is showing signs that they're tired, then they no longer have the energy for the transition. I learned that lesson yet again on Tuesday night with our 7 year old. We SHOULD have left the end of the school picnic at 7:40. We left at 8 pm. Dd had a major meltdown when we got home.
The kitchen timer. If I had one parenting tool that I would never be without, it'd be the kitchen timer. It is a 'neutral' third party, so when the timer beeps, time is up. Setting also means that my kids automatically got a warning. "When the timer beeps, it'll be time to put on pajamas." "OK, the timer beeped, finish up and let's go get pjs on." My kids are older now and we still use the timer, more as a reminder than anything else. And they've started using it on me. My kids have each set it for me in the last 2 days when I've said "Give me 15 minutes to digest my dinner/drink me tea, and I'll do that with you." "OK, I'll set the timer." (They're wise to the fact that my "15 minutes" can stretch to 30 if they're not careful!)
I have to say that the 5-3-1 minute warnings worked well for me. No, my kids didn't have any sense of the time, but it was the warning itself, and the repetition that helped. And I could 'stretch' those minutes if I realized they needed a little more time. So, we'd do '5 minutes', then '3 minutes' and when I got to '1 minute' then I'd say "do you want go down the slide or the fire pole before we leave?" "Read one more page and then we need to go." The combination of repeated warnings with a concrete "x and then we go" helped.