The warranty book I got (sorry, can't find it quickly on my phone,) says that the warranty transfers only if it is either a BMW Certified Preowned subsequent purchaser or if the sale is private-party-to-private-party. So if the car got traded in at a non-BMW dealer, the long warranty stops. But if you're a private buyer buying it from a private seller who was the original purchaser, the warranty transfers.
It also seems to me that the wording would be valid for subsequent private-to-private sales. So second owner to third owner, as long as the first-to-second was also a private party sale.