I would put your hat in your checked baggage.
From a practical perspective, you will be indoors and would not be likely to be wearing your hat. So, instead of having one more thing to handle, just put it in checked baggage in a place where you can easily retrieve it when you get your bags at your destination.