Its basically in the torque converter slip. When unlocked you are allowed a percentage of efficiency so the lower the stall the better as well as lower the power. Usually once you gain some rpm the Trans has less of an advantage (ESP right before the shift into the next gear) and it will lock.
They also sense slip with the converter locked, if its over a certain amount the converter will unlock. Then it may fight to re-lock anyone having issue should monitor tc slip and see at what point they have issues with it unlocking and report back