We do handle the problem of retrieving a newly generated identity column from the database and then matching it up with the appropriate object in the cache as it completes its roundtrip. If you want to, we are happy to allow you to use this mechanism
We also give you cimplete control of generating the keys for your new objects, so if you want you want to take complete control of this, you just need to hook into the IdGenerator interface. For more details, see the Developer's Guide.
However, if you just want to hook up to an event that happens just before and after each save to the PersistenceManager, use the Saving and Saved Events. Just before database save, the Saving event fires and you are free to modify the properties of each object before they go to the database. The database then fixes up the keys as they are being saved. After the the database save, the PersistenceManager roundtrips the data, and fires the Saved event, during which you can update the data.