Currently, source free domain adaptation (SFDA) methods are employed to address the issue of inaccessible source domain data (SDD) in transfer learning. However, existing SFDA methods often suffer from overfitting to specific domains, leading to poor generalization ability in the target domain. To address these challenges, this paper proposes a novel SFDA method named SFDA-T for fault diagnosis. Specifically, a Transformer-CNN-based feature extractor is constructed, to mine the transferable feature knowledge of faults in the SDD. The approach reduces the overfitting of the model to domain-specific information and improves model’s generalization ability. In addition, the feature attention loss is designed to calculate attention weights of the sample features to increase the model’s attention to the crucial feature regions in the target domain. A source similarity guided exponential loss is developed to guide target samples based on the decision boundaries of the source domain, facilitating cluster alignment of target sample categories and expanding distances between different categories. Furthermore, a self-training pseudo-labeling constraint is employed to reduce the effect of incorrect label matching and further constrain the model. The results of the experiments on gearboxes and bearings indicate that the proposed method achieves high fault diagnosis accuracy while effectively decoupling from SDD.