Differentiating the Black-Box: Optimization with Local Generative Surrogates