Interplay Between Optimization and Generalization of Stochastic Gradient Descent with Covariance Noise