Can a 12v base signal be used to switch a v5 device through a transistor?
Use a buck switching regulator (output 3v3) connected to your headlight wiring. No need for a switch. Don't use a linear regulator for this because it might dissipate too much power and burn (load dependant).

Buck regulators are near enough 90% efficient at transferring power so it will burn very little power. One word of warning is that with any regulator you should rate its input to withstand at least 42V. 42V is a recommended limit for surges in normal automotive environments although a 60V capable regulator will be better and, there are a few. Maybe this TI one: -