Yes, usually just clamp the integrator's accumulator value so that when the actuator is outside the linear control regime (eg. maxing out motor current because we're in the end-stop), the output of the controller doesn't continue increasing to infinity.
(Another way is stopping integration when control output is at its physical limit, usually in addition to a numeric limit.)
As with all other PID parameters, this is something you'd have to figure out more-or-less empirically.
Testing with hardware would be checking that controller outputs stop increasing while the actuator is blocked away from its target value, usually running with much reduced speed/current etc limits. Ideally, of course, run unit tests and SIL, before trying it on actual hardware.