Accurate prediction of the remaining useful life (RUL) of lubricants in rolling bearings is crucial for maintaining efficient operation of rotating machinery and ensuring timely lubricant replacement. We propose a comprehensive framework that integrates the temporal variation transfer function (TVTF), harmonic-sideband Matrix, and the harmonic frequency transformer (HarFT), a transformer-based model. This approach effectively utilizes vibration characteristics to enhance the accuracy of lubricant degradation prediction in rolling bearings. Validation with rolling bearings experiencing lubrication failure confirms that our framework significantly outperforms alternative methods in RUL prediction. The proposed framework excels in extracting and analyzing harmonic components from vibration responses, enabling detection of minute status variations due to lubricant degradation. By applying explainable artificial intelligence (XAI), it is possible to ascertain the rationale behind the RUL predicted by the HarFT model, facilitating evidence-based decisions. Our research provides a novel strategy for lubricant RUL assessment in rolling bearings, thereby improving reliability and maintenance efficiency in industrial applications.