The compensation or pension shall not be subject to attachment or execution, shall be payable only to the beneficiary designated and shall not be subject to assignment or transfer.