This one is easy and only pertains to recent New Era hats. Inside the hat should have a New Era tag. Attached is a care instruction flap that has a holographic strip running across the label. Look carefully and you'll see the "NEW ERA" logo repeated. These things are hard to duplicate and is a great way to check if a hat is legit.
NOTE: This is not to say that by having this, the hat is automatically legit. Use other methods or common sense to further determine if a hat is legit.
Here's a video on this process and make sure to check this out for further techniques.