You can use OnValidate(). That functions gets called whenever something changes in the inspector.
This will not tell you if something changed in the scene. You can hook into the AssetModificationProcessor to see when something is going to be saved if it was dirty.
I am not sure if there is a direct way to check if an Object is dirty.