As @Andrea_Martin states, in Collect each submission is independent so its not (currently) possible to maintain external state between submissions, which would be required for something like an autoincrementing counter. However, it is possible to use an external app to accomplish this (!), which Collect can then query via an external integer widget. There's an available counter app designed for just this purpose, along with instructions how to use it in a form, described here: https://github.com/opendatakit/counter
If you want to try and solve your usecase within the ODK toolset then using something like this is probably your best bet. [caveat: I've personally not played with this myself, yet, but it should do what it says. You may still need to adapt it somewhat for your specific id increment/override scenarios.., but its probably at least worth a look].