Ben Cockayne put in a man of the match performance for the Wakefield Wildcats in their 28-26 victory over the Widnes Vikings.