Many women get extremely anxious about memory loss in the perimenopause/menopause. Mostly its because they worry that this is early onset dementia, as nobody has warned them that brain fog (having difficulty remembering how to do routine tasks such as remembering where you parked, losing words mid sentence or forgetting why you walked into a room) is a classic menopause symptom. Brain fog during perimenopause/menopause is a symptom in its own right, not just a consequence of lack of sleep or depression. Although forgetting names and words is frustrating, the good news is that menopausal brain fog is temporary. When the hormones get back in balance the brain fog should certainly get better.
The parts of the brain that process the learning of new information are rich with oestrogen receptors. Oestrogen increases production levels of neurotransmitters such as acetylcholine that influence memory, and it also stimulates the growth of dendritic spines that enable nerve cells to communicate. In addition, oestrogen helps regulate glucose, inflammation and antioxidants in the brain. Neuro-imaging studies have shown that when oestrogen declines, there is markedly less cerebral blood flow and activity. Oestrogen also promotes increased blood flow to the brain. Oestrogen replacement therapy has maximum benefit when started close to the menopause. 
Studies have found that among women who are over 65 years old, those that take oestrogen replacement therapy perform better on cognitive tests and show less cognitive deterioration over time.    Another study found that women on oestrogen had better visual memory when compared to those not on oestrogen.  Women also had higher scores on verbal and fine motor skills tests and performed better in speed and accuracy tests when oestrogen levels were at their peak in their menstrual cycle. In my practice I have found that when women's hormonal symptoms are addressed, they come back and tell me they are 'firing on all cylinders' again.
Things you can do to keep memory sharp:
Exercise, particularly aerobic exercise helps: runners’ brains have shown increased levels of brain-derived neurotrophic factor, which is known to support the health of existing neurons and coax the creation of new brain cells. The link between exercise and memory is so great that a study of 162 sets of female twins over 10 years found that the twin with stronger leg extension had less age-related change in brain function and structure than her sister.
Eat well: eat good amounts of monounsaturated fats and low amounts of trans-fats. Good fats protect against cognitive decline, but trans-fats (found in processed foods like biscuits and cakes) were associated with a greater incidence of cognitive decline.
Prevent free radical damage to your brain with a diet rich in antioxidants. These need to be consumed in food form rather than taken as a supplement to provide benefit. Food rich in antioxidants include purple, red and blue fruits, nuts, dark green vegetables, sweet potatoes and orange vegetables.
Avoid alcohol, smoking, and the artificial sweetener aspartame.
Try the 5:2 diet (please see my blog on Intermittent fasting). Intermittent caloric restriction may be associated with improved cognitive performance and reduced rates of dementia.