Learning as a phenomenon occurring in a critical state