A formal UX degree is not mandatory but can be beneficial to learn the basic UX concepts and tools. You can even acquire near-relevant skills through a degree in computer science, human behavior and arts or design. Additionally, UX specific certifications can be beneficial in learning concepts like Information Architecture and prototyping.