2004 Chevy Malibu - Transmission or spark plugs

It is quite possible that the problem was the plugs and/or wires. Despite the plugs being 100K mile items, the wires were 10yrs old. That’s plenty old enough - so I think your reasoning for having it done was perfectly sound. And if you’re only doing about 7K miles/yr does that mean there is a lot of short trip driving? If so you might find a shorter interval for spark plug replacement based on a “severe duty” schedule.

On the subject of the transmission, has that ever been serviced? I don’t think it ever had anything to do with the hesitation, but just bringing it up in case you want to minimize the possibility of future problems. The best thing to do is have the pan dropped and filter changed, and it’s best about every 30K regardless of what the manual says.