Former prison guard pleads guilty after secret relationship with inmate