There are dongles for certain ebike motor brands that can do that. For example, you can explore the German
bikespeed site to find out which brands work with their dongles: Bosch, Yamaha, Brose, and a couple of others. There are several other dongle makers, but in general they address the major ebike manufacturers only. You will have to provide more specific information for people to help you: motor brand and model, etc.
Be aware that using such dongles probably voids the bike manufacturer's warranty and, depending on where your son rides, they may violate local laws as well.