The cigarette lighter on a H-D, unlike most American cars, is active only if the ignition switch is on. This means that the lights will be on too and a 9 V battery will not last long, if it works at all. A small 12 V battery or battery tender connected to the battery connection that is to be removed would work better.
I could be wrong, but I would check with the MOCO on this one. ECMs are programmed with "flash" memory, much the same principle as a memory stick or jump drive. They do not need power to maintain their memory. If that were the case, every battery change or dead battery would require reprogramming the ECM.
My battery died two weeks ago and my bike fired right up when I put the new battery in. The ECM uses flash memory like a car so you don't need to worry about it losing its memory.