The Generalized Lasso with Nonlinear Observations and Generative Priors