Could be a couple different things. You could be accidentally hitting the buttons while it's in your pocket. Given the phone's age the battery might just not be holding a charge like it used to (mine isnt, time for a new battery check Amazon). If you have a rooted phone it could be unstable and shutting off in which case i'd try a different ROM. Finally, it could be some kind of hardware defect due to age.
I love my Hero just as much as anybody, but you gotta realize that these phones are rapidly aging and will likely face more problems.