Cognitive and neural mechanisms subserving regularity learning