Yes, that is why I have the 2017 Trekking 4.0, which is basically the same bike (except the internal battery), because I put the S-motor on it ;)
Here in California, I don't need to worry about that, because it's still legal - nobody ever cares.
However, I could install my own tuning dongle, but...