Interpreting systems as solving POMDPs: a step towards a formal understanding of agency