A Theoretical Insight into Attack and Defense of Gradient Leakage in Transformer