As everything in UX, it all depends on context. Input masks are excellent at conveying the user the proper formatting you expect, and it also helps the user visualize data. for example:
Free form input: 1111111l11111111
Masked input: 1111-111l-1111-1111
It's easy for the user to see that after 7 characters s/he made a mistake that can be easily corrected. A similar case: Did I add the right amount of zeros? (this number is real and is part of my mother's form number, reason why I always wonder if I typed it right)
Free form input: 36000009
Masked input: 3600-0009
Another user case: my partner has a phone from England, but he lives in 3 different countries. Now, when asked for his phone, he will probably want to type something like
Free form input: 02577771111
but wait! that phone number is from UK, and he's filling this form in US. Wouldn't it be better to present him with the exact info he's required for? Like so:
Masked input: +44 (0)25 7777 1111
Another thing to consider is that we aren't always in control, and a front-end has to adjust to specific data requests from a back-end we have no way to modify. Thus, masking is a way to tell the user: "OK, we need data in this format" minimizing the need for validation errors (and user's frustration)
An approach:
An idea you can test when using masked inputs is to replicate natural language. For example, most western people tends to group numbers in blocks of 3 and 4 characters, CC numbers in blocks of four and so on. So there you have a good way to mask inputs improving legibility: just imitate natural language so users can easily see the input just as they think about it. It's way easier to do a visual scan of (123) 4567 8910
than to scan 12345678910
In short
Bottom line is that proper testing will show you whether to use one approach or the other. I like both approaches with a slight preference for masking, but both of them are equally useful depending on your needs. In short, rather than define the approach to follow, it's better to define your needs and then use he most adequate tools for those needs