Developmental shifts in computations used to detect environmental controllability