Nonlinear optical response as a probe for quantum geometry