Is it possible to create an auto-increment field in a content type?
There is A module called Serial, for drupal 8 it is in development version but can be downloaded and used, This module provides the same functionality as you desire.

You also can write your own module, you can set a configuration value in your module, set it to zero by default, and using hook_ENTITY_TYPE_presave, increase its value and set it to your entity.