A new study shows how hormones may slow cognitive decline