One possible solution.
Use 4 rechargeable AAA batteries, 2 in the sensor and 2 outside in a battery holder wired in parallel.
Wouldn't that make the batteries charge each other - Like the old expression, "water seeks its own level" - In other words, the 2 batteries inside are down to 2 volts, the ones outside are a fresh 2.4 volts - The electricity flows and makes the 2 pairs equal, or 2.2 volts all around. Then, when the voltage drops below the "threshhold", the motion sensor loses the codes
I think the batteries, if mounted in parallel, would act like a charger for each other unless you had the proper diodes to block the current from the other pair. Like a diode on each positive leg (1 from each pair) so that the current didn't flow into the other pair. That might work.
Not quite, if you have one set of batteries drawn down to 2V instead of 3V, they would do as you indicate.
Do AAA batteries last only 1 month? No, they are still fairly up there.
Assume 2.9 V.
Adding fresh 3.0 V batteries would make the combination 2.95V which is perfect!
If that is not perfect enough and you really want to go crazy
Keep 4 AAA batteries charged for each MS16a.
Change 2 and then change the other 2 that were in parallel.
No loss in power.
And finally: Bring a 3 Volt source with you with alligator clips.
Clip on the 3 Volts, remove and replace the batteries.
Remove clips.
Simple, tiny, cheap, and cosmetically exactly as original!
No loss in power.