Memory in quantum processes with indefinite time direction and causal order