Income and expenses have to be file in the year they were incurred. You would have to file an amended return for 2017. The question is can you deduct your legal fees for your job. If the fees were for a business you own, then the the fees would be a business expense. If you are an employee, then it would depend upon the exact nature of the fees and their relationship to you doing your job. You probably have to ask an accountant.