Modification of the optical and elastic properties of TlGaSe2 layered semiconductor produced by the memory effect