“Some vaccines show beneficial off-target effects on health that span beyond the protection against specific disease. This could be because they may improve immunity on a broad scale.” (snip) The brain’s immune system has long been implicated in the onset of Alzheimer’s—specifically, a disruption in the brain’s microglial cells—and general immune system health could therefore be an important mediator of cognitive decline.
Of course, it might also be true that smarter people are more likely to be immunized and, starting with more brain power, begin declining from a higher level. As you might guess, the article doesn't mention this semi-plausible possibility.