There are a few ways to do that. The way I would do: You should set up a common event checking the class and attributing a number to a variable, like this:
There are other ways, like in this thread: https://forums.rpgmakerweb.com/index.php?threads/trying-to-get-the-class-id-of-a-party-member-and-store-it-in-a-variable.111861/
RPG Maker Web forums = the best place to ask this kind of question