Dementia is associated with low levels of testosterone in men. [1]
Unfortunately, (over-the-counter) DHEA seems to have no effect on Alzheimer's, [2] though I'm not sure about other forms of dementia.
[1]: https://www.ncbi.nlm.nih.gov/pubmed/24035146
[2]: https://www.aan.com/PressRoom/Home/PressRelease/39 and https://www.ncbi.nlm.nih.gov/pubmed/16977674