Spectral lineshapes in nonlinear electronic spectroscopy