What is it? Some brands have transferable warranties, some don’t. AFAIK, Spesh is the only brand where the warranty transfers in full. Trek’s used to but they changed it a while ago. Cube, Haibike, Lapierre don’t transfer at all and they are not the only ones. Technically, the component warranty is with the component manufacturer, so as long as you have the original receipt the motor and battery should be covered if it’s a Bosch, no idea about Giant Sync-drive and Shimano seem to be doing their utmost to refuse warranty to all claimants, even the original purchaser…
Bosch, Giant/Yamaha and Brose/Spesh can all be repaired by third parties but Shimano seems to have so many random sensor failures (that aren’t available to the third party repairers) that most won’t touch them.
I put my (working) Rail away in November when I bought my KSL. When I got it out to clean up for sale in late February it no longer worked and was out of warranty. Performanceline Bearings sorted it for the princely sum of £197 plus shipping. It’s as good as new now and a good deal quieter than when I stopped using it.