Thanks to DavidPostill who suggested :
https://github.com/hirschmann/powereventprovider ;
[GitHub - hirschmann/powereventprovider: Power Event Provider service for Windows]
It looks quite promising, claiming to do what I wanted. I was unsure if the software was safe but the author looks reputable. I installed the .exe file easily in less than a minute.
I then created a Custom View under Applications and Services Logs in Windows Event Viewer according to the user guide on the webpage, choosing Event source as PowerEventProvider.
I switched off the electrical supply from the mains AC power then a minute later switched from battery to main AC power.
The events are successfully recorded in detail as I show in my screenshot below.
![system power source changed - battery or AcPowerSource](https://cdn.statically.io/img/i.sstatic.net/leEtD.png)
Thanks to Appleoddity for commenting but my Windows Event Viewer (under Windows Logs -> System) makes no distinction between AC or battery, simply logging it as "Power source changed." It is necessary to install the software suggested by DavidPostill.