I re-read you original post and suddenly unsure regarding what you’re looking for exactly.
You want to-
(A) have a single input field for phone number, that a user will type together the whole number (10 digits) and only stores this value later on as a 3 separate parts formatted number, meaning that this solution will be transparent to the user, and only effect your site’s stored data?
If yes - you can run some simple manipulation on the input value the user provided before you store the data. Look online for sub-strings and string concatenation (regex would be more proficient but probably a bit more complex).
(B) make this formatting available right when the user is typing the number, meaning this solution should improve the users experience and naturally be visible to them?
If yes - you can use 3 different input fields put aside one another in a row, and concat their values before storing the joint number in your site’s data.
Let me know if this gives you a lead / try to elaborate on what you’re looking for in case I didn’t understand you correctly.