Actually, that’s not correct. The aileron and elevator trims continue to function even with an autopilot installed and activated.
With the aileron trim, it’s force is very mild so it’s not an issue for the autopilot to override it. All it’s doing is adding additional pressure to the entire system to keep the wings level. And since it’s just a spring, it’s not a lot of force.
With the elevator trim, the autopilot’s electric trim makes the needed adjustments. You can even see the elevator trim knob move when you use the electric trim lever on the yoke.