Continuous time mean-variance portfolio optimization through the mean field approach