Inferring control objectives in a virtual balancing task in humans and monkeys