Are you using the AutoCompleteForMendix widget? you could change the ‘ResultDisplay’ to match your XXX-XX-6789 requirement and instead of looking for a matching string you could either search for results that contain the searched string or (if you do not want the user to be able to guess the ‘X’ digits by searching ;) ) you could use https://docs.mendix.com/refguide/string-function-calls endsWith or (for xPath) ends-width https://docs.mendix.com/refguide6/xpath-ends-with
You could add an attribute called DisplaySSN where its calculated by modifying the SSN attribute and creating XXX-XX-6789 using the substring and concat functions.
EDIT: on change of the SSN attribute, just call the microflow that sets the value for DisplaySSN.