Genetics, habits such as exercise, and factors including education can help people stave off cognitive decline