Transformers learn to implement preconditioned gradient descent for in-context learning