Spin correlations in electron liquids: Analytical results for the local-field correction in two and three dimensions