When applying for a job, it's important that you use your legal name and if they ask about your sex or gender, you need to put the legal one - not what you prefer. It's important to do it this way, because potential employers often perform a background check - and if you do get hired, they'll require to see a Social Security card (They'll copy it) and if the names don't match, this could cause you problems.
But there's nothing wrong with telling them your preferred name after you get hired, or during an interview.