Feature learning in neural networks and kernel machines that recursively learn features