As a rule on the field - setting it's value.
Formula:
concat(substring(translate(., "-", ""), 1, 2), "-", substring(translate(., "-", ""), 3))
================================================================
This formula contains embedded commands:
A = translate(., "-", "")
to remove all existing dashes before processing the current field value.
B = substring(A ,1 ,2)
C = substring(A, 3)
to separate the first two characters and the rest of the current field value into two components.
concat(B,"-",C)
to combine the separated parts together with a dash in between.