Cohort analysis over 3 months
To demonstrate how this can be done, I created some sample/dummy records. See my answer below with comments explaining each step:

(1) Prepare data and create a column to capture all ID's of active customers

import pandas as pd
import numpy as np
from dateutil.relativedelta import relativedelta

# Create a dataframe with five customers from three cohorts
df = pd.DataFrame({'txn_new_cif': [1, 1, 2, 3, 4, 5],
                   'CohortGroup': [np.datetime64('2018-01-01'), np.datetime64('2018-01-01'),
                                   np.datetime64('2018-02-01'), np.datetime64('2018-02-01'),
                                   np.datetime64('2018-02-01'), np.datetime64('2018-03-01')],
                   'Txn_date': [np.datetime64('2018-01-30'), np.datetime64('2018-07-01'),
                                np.datetime64('2018-05-01'), np.datetime64('2018-08-01'),
                                np.datetime64('2018-06-01'), np.datetime64('2018-12-30')]})

# Count the number of days between each transaction date and the cohort date
days_diff = df['Txn_date'] - df['CohortGroup']

# Convert into integer
df['Diff_days'] = days_diff.dt.days

# If the transaction occured during the first 120 days (30 days of cohort month + 90 days)..
# Then those customers are considered as 'active'
# Capture the ID of those active customers
df['Active_cif'] = df.loc[df['Diff_days'] &lt;= 120]['txn_new_cif']

# Find the date of each of the following three months after the end of the cohort month
df['First_month_after'] = [x+ relativedelta(months=2) for x in df['CohortGroup']]
df['Second_month_after'] = [x+ relativedelta(months=3) for x in df['CohortGroup']]
df['Third_month_after'] = [x+ relativedelta(months=4) for x in df['CohortGroup']]

# Calculate the cut-off date to determine whether the txn occured with the 1st/2nd/3rd month after
days_diff_1 = df['First_month_after'] - df['CohortGroup']
days_diff_2 = df['Second_month_after'] - df['CohortGroup']
days_diff_3 = df['Third_month_after'] - df['CohortGroup']

df['First_month_days'] = days_diff_1.dt.days
df['Second_month_days'] = days_diff_2.dt.days
df['Third_month_days'] = days_diff_3.dt.days

# Based on these cut-offs, determine if the activity took place within the 1st/2nd/3rd month after
df['Active_month'] = np.where(df['Diff_days'] &lt;= df['First_month_days'], df['First_month_after'], 
                              np.where(df['Diff_days'] &lt;= df['Second_month_days'], df['Second_month_after'],
                                      np.where(df['Diff_days'] &lt;= df['Third_month_days'], df['Third_month_after'], None)))

df['Active_month'] = pd.to_datetime(df['Active_month'])

df.head()


(2) Aggregate data by cohort

# Count the total number of customers in each cohort
cohort_cust_ct = pd.DataFrame(df.groupby(['CohortGroup', 'Active_month'])['txn_new_cif'].nunique()).reset_index()

# Count the total number of customers who were active in each cohort
cohort_act_ct = pd.DataFrame(df.groupby(['CohortGroup', 'Active_month'])['Active_cif'].nunique()).reset_index()

# Combine both results
df_grp = cohort_cust_ct.merge(cohort_act_ct, left_on=['CohortGroup', 'Active_month'], right_on=['CohortGroup', 'Active_month'],
                             how='outer')

# Calculate churn rate for each cohort
df_grp['Churn_rate'] = 1 - (df_grp['Active_cif'] / df_grp['txn_new_cif'])

# View results
df_grp.head()