A Neural Network Learns When It Should Not Be Trusted