I would make it a manual exercise. I would store the last used auto-increment number somewhere in the db and update it each time I need to create a new record.
This way you have full control over the number when a new year starts.
I would NOT use the db’s automatic auto-increment number, because you do not have much control over it - and the db often skip numbers when records were deleted or after a system crash or electrical power failure.
When you need to "increment’, get the latest number from the database (do some kind of filter/sort on the field), split it and create a new number. This is what I’ve seen done in a software generating invoices.
You can put such code in beforeSave/beforeValidate…