I had a similar situation shortly after we purchased our Springdale TT (like 2007 ish). We had this burning smell start radiating through the trailer. Because it was nightfall, I thought it was a neighbor camper burning trash in their fire pit. My wife kept insisting something was not right.
Sure enough, the smell was coming from only inside the camper. Fortunately, the water heater had easy access, under the rear bunk bed. I lifted up the bed and sure enough, smoke.
Well, we had no hot water on electric for the rest of that trip. But once home figured out what the problem was. The heating element failed and continued heating, would not shut off. It melted the insulation on the wires, and that's what the smell was. Electrical burn has a unique smell.
Pulled the old heating element and replaced it. Replaced some of the melted wires, and all was well after that until we sold the camper. There was nothing we could that would have prevented this, it's something that just happened.
Glad the OP caught the problem before it cause more serious problems.