Learning non-Markovian Dynamical Systems with Signature-based Encoders