How do I correctly wire a new light/switch from an outlet?
Electrically, this will work and your diagram is correct. You're lacking a bunch of construction concerns though. How are you getting from outlet to switch?, from switch to transformer, where will tx be mounted, what type of wire, etc.