An excerpt from a new book explores how the archetypal Western hat got its start in Hollywood—and why it endured.