Optimal Rates for Spectral-regularized Algorithms with Least-Squares Regression over Hilbert Spaces