How to Identify Multiple Insert Rows from Single Transaction
I would suggest using SEQUENCE
It is simple and the sequence value always increases in one way

-- you only need to create it once
create sequence seq as int start with 1
go

-- you can then do this
BEGIN TRANSACTION;
DECLARE @BatchID int = next value for seq
INSERT INTO dbo.Test2
       SELECT *, @BatchID AS [batch_id]
       FROM Test;
COMMIT TRANSACTION;