Monitoring membrane potential with second-harmonic generation