Lexico (Oxford Dictionaries) has it hyphenated when it's an adjective, but not when it's a noun.
Is it working class or working class?
The working class or the working classes are the group of people in a society who do not own much property, who have low social status, and who do jobs that involve using physical skills rather than intellectual skills. A quarter of the working class voted for him.
Does middle class have a hyphen?
The WR dictionary hyphenates the adjectival form 'middle-class', but leaves the adjective and noun form unhyphenated.