Retirement tax questions

Those legal expenses are not deductible on a federal tax return.  They may be deductible in some states that follow the pre-2018 rules for itemized deductions.  However, even then, the legal fees are deductible only as a percentage of the social security income that is taxable.  For example, all SS benefits are non-taxable in New York, so even though the legal fees are theoretically allowed as an itemized deduction, the deductible percentage is zero.  If you were to look at your state tax return and find that your SS benefit is 50% taxable, for example, then 50% of the legal fees may be listed as an itemized deduction.  Whether you actually benefit depends on your overall income and other deductions.