Yes it is possible: You, you can use the generic hook_entity_presave (or update/insert).
There is also a specific hook for profilesprofile2 as well:, hook_profile2_presave (or update/insert). It, but it requires the Rules module, though to be enabled.