His birth certificate will confirm whether he was illegitimate. If, as seems likely, he was, the chances of finding the identity of his father are slim. Your best bet would be the records of the Poor Law Guardians of the relevant Union (East and West Flegg). If James was potentially dependent on poor relief, the Guardians might have obliged his mother to seek an affiliation order.
FamilySearch has images of the E and W Flegg Guardians minute books available online. They are not indexed, though, so you will need to wade through the pages one by one.