A Preston man has been convicted of attempted murder after stabbing a British Transport Police officer.