Tablet mode settings are found in the registry under [HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell]
The two important keys for you are TabletMode and SignInMode (you may have to create them).
TabletMode:
0 = Off
1 = On
SignInMode:
0 = "Automatically switch to Tablet Mode"
1 = "Go to the desktop"
2 = "Remember what I used last"
But I can't find any key for the "When this device automatically switches tablet mode on or off'
Does anyone know what setting I need to control this?