I am sorry and made a mistake in the code. The propery way to call fit function is as follows
        # call fit on training data.
        self.transform.fit(self.train_X)
        self.train = train

Whenever you call self.transform(X_train), this will redirect to __call__ function in Standard Scaler and where self.mean_ and self.scale_ are defined as None and this was the reason for error.
I hope above change works.