I was always taught to squawk 7000 Mode C as soon as I had switched the landing light off on after take off checks (unless in the circuit) and switch it to STBY when I had the airfield in sight and switched my landing light on. This seems sensible, and is easy to remember:
Landing Light On: Transponder STBY
Landing Light Off: Transponder ON
F-Wyg