An essential aspect of resilience within Cyber-Physical Systems stands in their capacity of early detection of faults before they generate failures. Faults can be of any origin, either natural or intentional. Detection of faults enables predictive maintenance, where faults are managed through diagnosis and prognosis. In this paper we focus on intelligent predictive maintenance based on a class of machine learning techniques, namely transfer learning, which overcomes some limitations of traditional approaches in terms of availability of appropriate training datasets and discrepancy of data distribution. We provide a conceptual approach and a reference architecture supporting transfer learning within intelligent predictive maintenance applications for cyber-physical systems. The approach is based on the emerging paradigms of Industry 4.0, the industrial Internet of Things, and Digital Twins hosting run-time models for providing the training data set for the target domain. Although we mainly focus on health monitoring and prognostics of industrial machinery as a reference application, the general approach is suitable to both physical- and cyber-threat detection, and to any combination of them within the same system, or even in complex systems-of-systems such as critical infrastructures. We show how transfer learning can aid predictive maintenance with intelligent fault detection, diagnosis and prognosis, and describe some the challenges that need to be addressed for its effective adoption in real industrial applications.