First thing you need to do is determine if its a hub issue or transfercase issue. The easy way is to have a friend watch the axles or driveshaft and slowly move the truck. Or, you can put the entire truck on jack stands, engage 4wd and watch the drivetrain.
I would bet its the auto locking...