Regression: Additional arguments in TransformChain subclass no longer work
Labels: name: auto:bug, name: area: models

### System Info

LangChain Version: 0.0.260
Python Version: 3.11.4
Operating System: ubuntu-22.04

### Who can help?

@hwchase17 

### Information

- [ ] The official example notebooks/scripts
- [X] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [X] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

After updating from version 0.0.256 to 0.0.260, I noticed that the TransformChain subclass which used to accept additional arguments (memory) no longer works. This regression might be related to changes made in [Pull Request #8762](https://github.com/langchain-ai/langchain/pull/8762).

### Relevant Code:

Here's a snippet of the MySubclassedTransformChain:

```python
class MySubclassedTransformChain(TransformChain):
    memory: BaseChatMemory

    def _call(
        self,
        inputs: Dict[str, str],
        run_manager: Optional[CallbackManagerForChainRun] = None,
    ) -> Dict[str, str]:
        return self.transform(inputs, memory=self.memory)

    async def _acall(
        self,
        inputs: Dict[str, Any],
        run_manager: Optional[AsyncCallbackManagerForChainRun] = None,
    ) -> Dict[str, Any]:
        if self.atransform is not None:
            return await self.atransform(inputs, memory=self.memory)
        else:
            self._log_once(
                "TransformChain's atransform is not provided, falling"
                " back to synchronous transform"
            )
            return self.transform(inputs, memory=self.memory)
```

Usage:

```
transform_chain = MySubclassedTransformChain(input_variables=["input"], output_variables=["output"], transform=transform_func, memory=memory)
llm_chain = LLMChain(llm=llm, prompt=prompt, memory=memory)
sequential_chain = SimpleSequentialChain(chains=[transform_chain, llm_chain])
sequential_chain.run(message)
```

Exception Stack Trace:

```
app-1  | ERROR:    Exception in ASGI application
app-1  | Traceback (most recent call last):
app-1  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
app-1  |     result = await app(  # type: ignore[func-returns-value]
app-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
app-1  |     return await self.app(scope, receive, send)
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 289, in __call__
app-1  |     await super().__call__(scope, receive, send)
app-1  |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/starlette.py", line 348, in _sentry_patched_asgi_app
app-1  |     return await middleware(scope, receive, send)
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/asgi.py", line 141, in _run_asgi3
app-1  |     return await self._run_app(scope, lambda: self.app(scope, receive, send))
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/asgi.py", line 190, in _run_app
app-1  |     raise exc from None
app-1  |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/asgi.py", line 185, in _run_app
app-1  |     return await callback()
app-1  |            ^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
app-1  |     await self.middleware_stack(scope, receive, send)
app-1  |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/starlette.py", line 143, in _create_span_call
app-1  |     return await old_call(app, scope, new_receive, new_send, **kwargs)
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
app-1  |     raise exc
app-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
app-1  |     await self.app(scope, receive, _send)
app-1  |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/starlette.py", line 242, in _sentry_exceptionmiddleware_call
app-1  |     await old_call(self, scope, receive, send)
app-1  |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/starlette.py", line 143, in _create_span_call
app-1  |     return await old_call(app, scope, new_receive, new_send, **kwargs)
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
app-1  |     raise exc
app-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
app-1  |     await self.app(scope, receive, sender)
app-1  |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/starlette.py", line 143, in _create_span_call
app-1  |     return await old_call(app, scope, new_receive, new_send, **kwargs)
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
app-1  |     raise e
app-1  |   File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
app-1  |     await self.app(scope, receive, send)
app-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
app-1  |     await route.handle(scope, receive, send)
app-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
app-1  |     await self.app(scope, receive, send)
app-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
app-1  |     response = await func(request)
app-1  |                ^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/fastapi.py", line 131, in _sentry_app
app-1  |     return await old_app(*args, **kwargs)
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 273, in app
app-1  |     raw_response = await run_endpoint_function(
app-1  |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 190, in run_endpoint_function
app-1  |     return await dependant.call(**values)
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/app/app/main.py", line 47, in post_message
app-1  |     result = await handle_message(message)
app-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/app/app/message_chain.py", line 20, in handle_message
app-1  |     assistant_result = assistant_chain.run(extraction_result, memory=manager.memory)
app-1  |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/app/app/assistant_chain.py", line 63, in run
app-1  |     response = sequential_chain.run(message)
app-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/langchain/chains/base.py", line 475, in run
app-1  |     return self(args[0], callbacks=callbacks, tags=tags, metadata=metadata)[
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/langchain/chains/base.py", line 282, in __call__
app-1  |     raise e
app-1  |   File "/usr/local/lib/python3.11/site-packages/langchain/chains/base.py", line 276, in __call__
app-1  |     self._call(inputs, run_manager=run_manager)
app-1  |   File "/usr/local/lib/python3.11/site-packages/langchain/chains/sequential.py", line 180, in _call
app-1  |     _input = chain.run(_input, callbacks=_run_manager.get_child(f"step_{i+1}"))
app-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/langchain/chains/base.py", line 475, in run
app-1  |     return self(args[0], callbacks=callbacks, tags=tags, metadata=metadata)[
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  |   File "/usr/local/lib/python3.11/site-packages/langchain/chains/base.py", line 282, in __call__
app-1  |     raise e
app-1  |   File "/usr/local/lib/python3.11/site-packages/langchain/chains/base.py", line 276, in __call__
app-1  |     self._call(inputs, run_manager=run_manager)
app-1  |   File "/app/app/langchain_extensions.py", line 14, in _call
app-1  |     return self.transform(inputs, memory=self.memory)
app-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app-1  | TypeError: Runnable.transform() got an unexpected keyword argument 'memory'
```

Transform Function:

```
def transform_func(inputs: dict, memory: BaseChatMemory) -> dict:
    text = inputs["text"]
    # mutate text with memory
    return {"output": text}
```

### Expected behavior

The subclass should handle additional arguments in MySubclassedTransformChain as it did in version 0.0.256.