What you describe is called “MAC-based VLAN” in RouterOS. A unit, switch-wise similar to yours (CRS3xx), running RouterOS is capable of doing it (see manual).
But could well be that SwOS doesn’t expose necessary config space of switch chip while ROS does … so it can’t be done on CSS3xx devices.
I’ve found an old thread about the same issue without solution.