In the DynamoDB table stack, export the StreamArn attribute of the table. Use that as the value of the EventSourceArn to define an EventSourceMapping resource in your Lambda stack.
# DynamoDB stack
Resources:
Table:
Type: AWS::DynamoDB::Table
Properties:
StreamSpecification: NEW_AND_OLD_IMAGES
# etc.
Outputs:
TableStreamArn:
Value: !GetAtt Table.StreamArn
Export:
Name: StreamArn
# Lambda stack
Resources:
Function:
Type: AWS::Lambda::Function
# etc.
EventMapping:
Type: AWS::Lambda::EventSourceMapping
Properties:
EventSourceArn: !ImportValue StreamArn
FunctionName: !GetAtt Function.Arn
# etc.
You could also do it the other way around - import the Lambda function ARN to the DynamoDB stack and define the event mapping there, but that feels less logical to me.