Hook for removing a role from a user
You can use Rules module for it. There is an event "After updating an existing user account", add conditions "User has roles" (both for account-unchanged and account parameters to check roles before and after an update), and as a action you can use "Run custom PHP code" to do whatever you want.