Role of connectivity topology in the transition between retrieving and non-retrieving phases in neural networks