Accurately estimating the remaining useful life of a battery pack is crucial for battery management systems, particularly in the context of the developing energy industry. However, most existing prediction methods overlook the relationship between time series and relative position. In response to these issues, this paper presents a novel neural network based on Auto-Encoder and modified Transformer. Firstly, preprocess the raw data and transform it into a list of capacities. Next, Auto-Encoder is used to reconstruct the preprocessed data, capturing temporal information more effectively. Subsequently, modified Transformer with relative positional encoding is introduced, enabling accurate capture of temporal information and feature extraction by combining parallel inputs of temporal sequence and relative positional encoding. Finally, to optimize training efficiency and save computational resources, a joint training approach is implemented, promoting parameter sharing and optimization, which further improves training effectiveness. The suggested approach is verified on a dataset of batteries from the University of Maryland. The results showcase the superiority of this approach over existing methods, demonstrating better predictive performance and higher training efficiency.