A Precise Characterization of SGD Stability Using Loss Surface Geometry