That functionality must be baked into the aircraft firmware as that's what originally added Remote ID to the Mini 4 Pro after it was released. The firmware is able to detect the type of battery being used.
The fact that you do this type of flying requires a Part 107 certificate in the first place. I wouldn't worry about going over 250g as any Part 107 operation requires a registered aircraft.