The first thing is to find which prison if you don't already know it. After trial calendars (lists) of prisoners are held at The National Archive at Kew in series HO 140. Do you know in which county the trial/offence took place? The calendars are arranged by year, then by county, so if you don't know this, you might have a long search! :-) See TNA website
http://discovery.nationalarchives.gov.uk/SearchUI/details?Ur... Once you know the prison, the records for individual prisons are also held mostly at TNA, although some may be held with the local county archives, depending on dates. Be prepared for the fact that prison record survival is sometimes patchy! :-)