I have done this by creating the database table ahead of time with the identity column and the remaining fields from the text file. Then, in the SSIS package map all text file data fields to the appropriate database fields. The database will handle the identity field when data is inserted into the remaining fields.
CREATE TABLE table_name
(
Id [int] IDENTITY(1,1) NOT NULL,
column_name2, -- From text file field 1
...
column_name3 data_type(size), -- text file field n
);
Hope that helps.