Losing to Mayweather has, in general, decreased Hattons stock. If he was 46-0 now, talking about breaking Marciano's record, or retiring undefeated, he would generally be regarded in a better light. That is wrong IMO and bad for boxing - but that's just the way it is. In an ideal world, imo, a decisive loss to an elite fighter should neither decrease or increase a boxers stock from what it was before. As far as the question about getting credit for a loss goes, on some occasions it's valid: take Duran's efforts against Marvin Hagler for example. You also get close matches such as Tito v Oscar (where Oscar deserves some credit there) or Castillo v Mayweather 1. Unless it's a very close classic fight though, I shouldn't think Hatton will get any credit to losing to any of these guys. It's not like he's doing a Duran weight moving feat.
I think Hatton could be given something of a "freebee" for losing to Mayweather but losses to either of Pac or JMM will put a big dent in his legacy.