When money is sent over in trades, the team sending the cash is charged for the luxury tax, and the team receiving the cash gets to deduct that amount from their taxable payroll. Cash sent in trades is applied year-by-year for the tax though.
Wells contract counts as $18M/year for luxury tax. This year the Angels are sending the Yankees $10M, next year the Angels are sending $18M.
So for the luxury tax, Wells counts $10M against the Angels and $8M against the Yankees for 2013. He counts $18M against the Angels and $0 against the Yankees for 2014. The deal was structured this way as the Yankees are trying to get under $189M for the tax in 2014.