Jelly, 29 26 25 bytes
⁶Øa;3ṗ¤,©Ṛy;L3ḍƊ¡⁶$ZFs3®y©Ṛy;⁶$L3ḍƊ¡ZFs3®y
Try it online!Try it online!
How it works
⁶Øa;3ṗ¤,©Ṛy;L3ḍƊ¡⁶$ZFs3®y©Ṛy;⁶$L3ḍƊ¡ZFs3®y Main link. Argument: s (string)
⁶ Set the return value to space.
Øa; Append it to "a...z".
3ṗ¤ Yield the third Cartesian power of [1, 2, 3].
,© Pair the results and store the pair in the register.
The register now holds
[[[1, 1, 1], ..., [3, 3, 3]], ['a', ... ,'z', ' '].
Ṛ Reverse the outer array.
;L3ḍƊ¡⁶$;⁶$ Yield s, possibly with an appendedAppend a space to s...
L3ḍƊ¡ if the length is divisible by 3.
y Transliterate according to the mapping to the left.
ZFs3 Zip/transpose, flatten, split into chunks of length 3.
®y Transliterate according to the mapping in the register.