Implement a strange automaton
V, 26 22 21 bytes

Thanks to @CowsQuack for 4 bytes by combining regexes! And @ØrjanJohansen for another byte with some regex combinations.

Ó1../3
Ó./&amp;1
Ó31/0
A1


Try it online!

Uses substitute multiple times and appends a 1 at the end.  Nothing too fancy.  I have a version that remaps 1 and 0 in insert mode to get the desired effect, but it's quite a bit longer.

(Multiple replacement version: Try it online!)