If you are using ArcEmu, you can make Transmogrification with Lua.
Let me show you an example:
local OBJECT_END = 0x0006
local UNIT_END = OBJECT_END + 0x008E
local PLAYER_VISIBLE_ITEM_16_ENTRYID = UNIT_END + 0x00A5 -- Main Hand Slot.
player:SetUInt32Value(PLAYER_VISIBLE_ITEM_16_ENTRYID, Transmogrification Item Entry ID)
So, basically you have to change the Transmogrification Item Entry ID with an in-game item.
You can also check if player main hand weapon is an sword, an axe or an polearm by checking it's entry id, and then make an world query and check for the subclass in Items Table.