Marginal deformations and defect anomalies