implement afterSave and if isNewRecord == true (it will be for new records as this flag is changed after call to afterSave handler) and perform additional update in that handler.
use database trigger "on insert" and put that logic there…
if you use dbms with sequences (like Postgres, not MySQL with autoincrement columns) - you could manually get next sequence id and assign it to both primaryKey and that second column…